setSource

open fun setSource(idx: Int, play: Boolean)

Sets the current source by its index in the playlist, with an option to control immediate playback.

The index is 0-based. If the provided index is out of bounds, it will be wrapped to a valid index within the playlist size.

Parameters

idx

The 0-based index of the source in the playlist.

play

If true, the new source starts playing immediately. If false, the source is set as current, but playback is not initiated by this call.


open fun setSource(source: Source, play: Boolean)

Sets the current source, with an option to control immediate playback.

The source must exist within the current module's playlist.

Parameters

source

The Source object to set. Must not be null.

play

If true, the new source starts playing immediately (if not already current). If false, the source is set as current, but playback is not initiated by this call.


open fun setSource(idx: Int)

Sets and plays the source specified by its index in the playlist.

The index is 0-based. If the provided index is out of bounds, it will be wrapped to a valid index within the playlist size. Playback of the new source starts immediately.

Parameters

idx

The 0-based index of the source in the playlist.


open fun setSource(source: Source)

Sets and plays the specified Source in the playlist.

The source must exist within the current module's playlist. Playback of the new source starts immediately.

Parameters

source

The Source object to set and play. Must not be null.